<?php

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('rentalunit-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<p>
<h2>Rental Units</h2>
The individual units at above property. 

<?php 

echo CHtml::link(CHtml::encode('Add Unit' ), array('/adminpanel/rentalunit/create','pid'=>$pid)); ?> here.</p>

<?php 
$countR=0;
$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'rentalunit-grid',
	'dataProvider'=>$dataProvider,
		'columns'=>array(
		'UnitNumber',
		'SoftwareUnitCode',
		'RentalAmount',
		'SubsidizedRent',
		'IncomeQualifiedUnit',
		'WaterSewerIncluded',
		'HeatIncluded',
		'ElectricIncluded',
		
		array(
			'class'=>'CButtonColumn',
    'template'=>'{update} {delete}',
    'buttons'=>array
    (
       /* 'view' => array
        (
            'label'=>'View Detail',
            'imageUrl'=>Yii::app()->request->baseUrl.'/assets/a99e585a/gridview/view.png',
            'url'=>'Yii::app()->createUrl("/adminpanel/rentalunit/view", array("id"=>$data->id))',
        ),*/
        'update' => array
        (
            'label'=>'Update Detail',
            'imageUrl'=>Yii::app()->request->baseUrl.'/assets/a99e585a/gridview/update.png',
            'url'=>'Yii::app()->createUrl("adminpanel/rentalunit/update", array("id"=>$data->id))',
            
        ),
		
		'delete' => array
        (
            'label'=>'Delete',
            'imageUrl'=>Yii::app()->request->baseUrl.'/assets/a99e585a/gridview/delete.png',
            'url'=>'Yii::app()->createUrl("adminpanel/rentalunit/delete", array("id"=>$data->id))',
            
        ),
		
    ),
		),
	),
)); ?>
